const Express = require("express");
const ImgParamServer = require("../../servers/ImgParam");
const ResponseHelper = require("../ResponseHelper");
const router = Express.Router();
/**
 * 根据id获取记录
 */
router.get("/getImgParam/:id", async (req, res) => {
  try {
    const Id = req.params.id;
    const result = await ImgParamServer.getImgParamById(Id);
    ResponseHelper.sendData(result, res);
  } catch (err) {
    ResponseHelper.sendErr(err, res);
  }
});
/**
 * 根据id更新记录
 */
router.post("/updateImgParam/:id", async (req, res) => {
  try {
    const params = req.body;
    const Id = req.params.id;
    const result = await ImgParamServer.updateImgParam(Id,params);
    ResponseHelper.sendData(result, res);
  } catch (err) {
    ResponseHelper.sendErr(err, res);
  }
});
module.exports = router;
